package com.speily.cloud.order.service;

import com.speily.cloud.order.dao.entity.Order;
import com.speily.cloud.order.dao.mapper.OrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * OrderServiceImpl
 *
 * @author : SPL
 * @since : 2021-04-20 14:34
 **/
@DubboService
@Slf4j
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public String createOrder() {
        log.info("执行创建订单");
        Order order = new Order();
        order.setCommodityCode("phone");
        order.setCount(1);
        order.setUserId("111");
        order.setMoney(5050d);
        orderMapper.insert(order);
//        throw new RuntimeException("测试异常");
        return "创建订单";
    }
}
